define(function(require, exports, module) {

	"use strict";
	require("mui");
	require("jquery");
	require("common");
	var muiTips = require("muiTips");
	var abpdata = require("abpinit");
	var abp = abpdata.abpstart;
	require('http://g.alicdn.com/ilw/ding/0.8.9/scripts/dingtalk.js');
	//钉钉返回清除缓存
	var dingTalkNav = require('dd_config');
	//钉钉右边按钮操作
	dingTalkNav.RightNavBar(false, "新增", "default");
	mui.init({
		swipeBack: true, //启用右滑关闭功能
	});
	$(function() {
		//ios
		dingTalkNav.LeftNavBar();
		//ad
		dingTalkNav.leftAndroid();

		mui("body").on('tap', "#sub-btn button", function() {
			var userMobile = $(".userTEL").val();
			if(!userMobile) {
				muiTips.alertAutoma(' ', "手机号不能为空，请您输入手机号码！", 2, "default");
				return;
			}
			if(!(/^1[34578]\d{9}$/.test(userMobile))) {
				muiTips.alertAutoma(' ', "输入的手机号不正确，请您重新输入！", 2, "default");
				return;
			}
			var option = {};
			var dataModel = {
				"userMobile": userMobile,
				"fullName": ""
			};
			abp.services.app.feedBack.attend(dataModel, option).
			done(function(data) {
				muiTips.alertAutoma(' ', "恭喜你报名成功，24小时内专线客服会与您联系！", 1, pageOpen);
			}).fail(function(data) {
				muiTips.alertAutoma(' ', data.message, 2, "default");
			});

		});
		
		function pageOpen(){
			document.location.href="../../src/feedbackHelp/help.html?dd_nav_bgcolor=FFFF943E";
		}

	});

});